using System;
using System.Collections.Generic;
using System.Text;
using Business.Entities;
using Data.Database;

namespace Business.Logic
{
    public class PlanLogic: BusinessLogic
    {
        #region Propiedad
        private PlanAdapter _PlanData;
        public PlanAdapter PlanData
        {
            get { return _PlanData; }
            set { _PlanData = value; }
        }
        #endregion

        #region Constructor
        public PlanLogic()
        {
            this.PlanData = new PlanAdapter();
        }
        #endregion

        #region Metodos
        public Planes GetAll()
        {
            try
            {
                return PlanData.GetAll();
            }
            finally
            {
                PlanData = null;
            }
            
        }

        public Planes GetOne(int ID)
        {
            try
            {
                return PlanData.GetOne(ID);
            }
            finally
            {
                PlanData = null;
            }
            
        }

        public Planes GetAllPorEspecialidad(int ID)
        {
            PlanAdapter PlanData = new PlanAdapter();
            try
            {
                return PlanData.GetAllPorEspecialidad(ID);
            }
            finally
            {
                PlanData = null;
            }
        }

        public void Delete(int ID)
        {
            try
            {
                PlanData.Delete(ID);
            }
            finally
            {
                PlanData = null;
            }
            
        }

        public void Save(Plan plan)
        {
            PlanData.Save(plan);
        }

        public void Update(Plan plan)
        {
            try
            {
                PlanData.Update(plan);
            }
            finally
            {
                PlanData = null;
            }
        }

        public void Insert(Plan plan)
        {
            try
            {
                PlanData.Insert(plan);
            }
            finally
            {
                PlanData = null;
            }
        }
        #endregion
    }
}
